package com.fang.system.rpc.pool;

import io.netty.channel.socket.nio.NioSocketChannel;

/**
 * @author fanglingxiao
 * @version 1.0
 * @description TODO
 * @date 2022/7/16 5:28 下午
 **/
public class ClientPool {
    public NioSocketChannel[] clients;
    private Object[] locks;

    public ClientPool(int initPollSize) {
        if (initPollSize <= 0) {
            throw new IllegalArgumentException("client pool size need more than zero");
        }
        clients = new NioSocketChannel[initPollSize];
        locks = new Object[initPollSize];
        for (int i = 0; i < initPollSize; i++) {
            locks[i] = new Object();
        }
    }
}
